/* 添加成绩表单样式 - 考研专用 */
.score-form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.form-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f8f9fa;
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    color: white;
}

.section-icon.exam {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.section-icon.score {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.section-icon.analysis {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.section-icon.loss {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

/* 表单网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-label i {
    width: 16px;
    margin-right: 0.5rem;
    color: #718096;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-control:hover, .form-select:hover {
    border-color: #cbd5e0;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 编辑模式下禁用字段样式 */
.form-control:disabled, .form-select:disabled {
    background-color: #f8f9fa;
    opacity: 0.7;
    cursor: not-allowed;
    color: #6c757d;
}

/* 科目选择器在编辑模式下完全禁用 */
.edit-mode #id_subject.form-select:disabled {
    background-image: none;
    pointer-events: none;
    user-select: none;
}

/* 分数预览卡片 */
.score-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: fadeInUp 0.5s ease-out;
}

.score-display {
    text-align: center;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-value.text-success {
    color: #68d391 !important;
}

.score-value.text-warning {
    color: #faf089 !important;
}

.score-value.text-danger {
    color: #fc8181 !important;
}

.score-max, .score-percentage {
    font-size: 1rem;
    opacity: 0.9;
}

/* 按钮样式 */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary-custom:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-primary-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline-custom {
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-custom:hover {
    border-color: #4299e1;
    color: #4299e1;
    background: #f7fafc;
    text-decoration: none;
}

/* 学生选择器 */
.student-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.student-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    height: 100%;
}

.student-card:hover {
    border-color: #4299e1;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.student-card.selected {
    border-color: #4299e1;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
}

.student-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.student-info {
    flex: 1;
    min-width: 0;
}

.student-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.student-meta {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.4;
}

.student-subjects {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subject-tag {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: #4a5568;
}

.selection-actions {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* 进度条样式 */
.progress {
    background-color: #e9ecef;
    border-radius: 0.375rem;
    overflow: hidden;
}

.progress-bar {
    background-color: #007bff;
    color: white;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1;
    transition: width 0.6s ease;
}

.progress-bar.bg-success {
    background-color: #28a745 !important;
}

.progress-bar.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

.progress-bar.bg-danger {
    background-color: #dc3545 !important;
}

/* 难度系数指示器样式 */
.difficulty-indicator {
    margin-top: 8px;
}

.difficulty-labels {
    margin-bottom: 4px;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge.bg-secondary { background-color: #6c757d !important; }
.badge.bg-success { background-color: #28a745 !important; }
.badge.bg-info { background-color: #17a2b8 !important; }
.badge.bg-warning { background-color: #ffc107 !important; color: #212529; }
.badge.bg-danger { background-color: #dc3545 !important; }

/* 错误状态 */
.error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.has-error .form-control,
.has-error .form-select {
    border-color: #e53e3e;
}

.has-error .form-control:focus,
.has-error .form-select:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* 表单文本 */
.form-text {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
    display: block;
}

/* 页面标题 */
.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

/* 分析卡片 */
.analysis-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #4299e1;
}

/* 失分明细相关样式 */
.loss-detail-item {
    border-left: 4px solid #dc3545;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-out;
}

.loss-detail-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast提示样式 */
.alert.position-fixed {
    animation: slideInRight 0.3s ease-out;
}

/* 加载动画 */
.fa-spinner.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .score-form-container {
        padding: 0 1rem;
    }

    .form-section {
        padding: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-icon {
        margin-right: 0;
    }

    .student-selection-grid {
        grid-template-columns: 1fr;
    }

    .student-card {
        padding: 1rem;
    }

    .student-avatar-large {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-right: 0.75rem;
    }

    .score-display {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons > div {
        width: 100%;
    }

    .btn-primary-custom,
    .btn-outline-custom {
        width: 100%;
        justify-content: center;
    }
}

/* 调试信息 */
.debug-info {
    background: #f8f9fa;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
    font-size: 0.875rem;
}

/* 文本颜色工具类 */
.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-danger { color: #dc3545 !important; }
.text-muted { color: #6c757d !important; }

/* 编辑模式特殊样式 */
.edit-mode .disabled-field {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* 科目选择器在编辑模式下完全禁用 */
.edit-mode #id_subject {
    background-image: none !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* 确保模态框有最高优先级 */
.modal.fade.show {
    z-index: 1060 !important;
}

.modal-backdrop.fade.show {
    z-index: 1050 !important;
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    pointer-events: auto !important;
}

.modal-body, .modal-footer {
    pointer-events: auto !important;
}

.modal input, .modal select, .modal textarea, .modal button {
    pointer-events: auto !important;
}
/* 编辑模式特殊样式 */
.edit-mode .disabled-field {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
}

/* 科目选择器在编辑模式下完全禁用 */
.edit-mode #id_subject {
    background-image: none !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* 为body添加编辑模式类 */
body.edit-mode {
    /* 可以添加一些全局的编辑模式样式 */
}

/* 三列网格布局 */
.form-grid.three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-grid.three-columns {
        grid-template-columns: 1fr;
    }
}